Imports System.Xml
Imports System.Net
Imports System.IO
Imports System.Deployment
Public Class My_Radio

    Dim api As New Nabaztag_API

    Private Sub My_Radio_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'RabbitDataSet.Rabbit' table. You can move, or remove it, as needed.
        'TODO: This line of code loads data into the 'Radio._Radio' table. You can move, or remove it, as needed.
        Me.RadioTableAdapter.Fill(Me.Radio._Radio)
        'TODO: This line of code loads data into the 'RabbitDataSet.Rabbit' table. You can move, or remove it, as needed.
        Me.RabbitTableAdapter.Fill(Me.RabbitDataSet.Rabbit)

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim Rl As New Radio_List
        Rl.Show()

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim api_return As String

        api_return = api.radioapi(serialbox.Text, tokenbox.Text, url.Text)

        Dim stringItems() As String = api_return.Split("[")
        ' Display the URI we sent to the api. This is useful for debugging to see what goes on
        urioutput.Text = stringItems(0)
        ' Display the message the API returns.
        status.Text = stringItems(1)


    End Sub

    Private Sub ComboBox2_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ComboBox2.MouseClick
        Me.RabbitTableAdapter.Fill(Me.RabbitDataSet.Rabbit)

    End Sub

    
    Private Sub FillByToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillByToolStripButton.Click
        Try
            Me.RabbitTableAdapter.FillBy(Me.RabbitDataSet.Rabbit)
        Catch ex As System.Exception
            System.Windows.Forms.MessageBox.Show(ex.Message)
        End Try

    End Sub
End Class